package com.dy.design_pattern_study.store_cashier_system.factory.impl;

import com.dy.design_pattern_study.store_cashier_system.factory.CashSuper;

/**
 * @CreateBy zhangdingyi
 * @Date 2023-03-07
 * @Content 打折收费子类 打折收费，初始化时需要传入打折的扣率
 */
public class CashRebate extends CashSuper {

    private double moneyRebate = 1d;

    public CashRebate(String moneyRebate) {
        this.moneyRebate = Double.valueOf(moneyRebate);
    }

    @Override
    public double acceptCash(double money) {
        return money * moneyRebate;
    }
}
